<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
	<table class="table table-striped" id="products">
		<caption>散标</caption>
		<thead>
			<tr>
				<th>借款标题</th>
				<th>年利率</th>
				<th>金额</th>
				<th>期限</th>
				<th>进度</th>
				<th>状态</th>
			</tr>
		</thead>
		<tbody>

		</tbody>
	</table>
	<ul class="pager">
		<li id="pre" class="disabled"><a href="javascript:preProducts()">上一页</a>
		</li>
		<li id="next" class=""><a href="javascirpt:nextProducts()">下一页</a>
		</li>
	</ul>
	<input class="hidden" id="number" value="${pageNumber }">
	<script type="text/javascript">
		var page = 1;
		var total = 0;
		var number = $("#number").val();
		var url = {
			query : "product/query"
		}
		$(document).ready(function() {
			loadProducts(url.query, page);
		});
		function preProducts() {
			if (page > 1)
				loadProducts(url.query, page - 1);
		}
		function nextProducts() {
			var maxPage = parseInt(total % number == 0 ? total / number : total
					/ number + 1);
			if (page < maxPage)
				loadProducts(url.query, page + 1);
		}
	</script>
</body>
</html>